import request from '@/utils/request'



export function getUnitList(params) {
  return request({
    url: '/md/unit/list',
    method: 'get',
    params
  })
}

export function deleteUnit(params) {
    return request({
      url: `/md/unit/del/${params.measureId}`,
      method: 'get',
      params
    })
  }

  export function selectUnitByMeasureId(params) {
    return request({
      url: '/md/unit/selectUnitByMeasureId',
      method: 'get',
      params: params
    })
  }

  export function deleteBatchUnit(params) {
    return request({
      url: '/md/unit/delBatch',
      method: 'post',
      data: params
    })
  }

  export function updateUnit(params) {
    return request({
      url: '/md/unit/update',
      method: 'post',
      data: params
    })
  }


  export function addUnit(params) {
    return request({
      url: '/md/unit/add',
      method: 'post',
      data: params
    })
  }

  export function findPrimaryUnit() {
    return request({
      url: '/md/unit/findPrimaryUnit',
      method: 'get'
    })
  }

  export function downloadTemplate() {
    return request({
      url: '/md/unit/download/excel/template',
      method: 'get'
    })
  }